public class OpportunityPagination {

  
    public PageReference delAccount() {
        return null;
    }


    public PageReference viewAccount() {
        String id=PageUtils.get('oid');
        Pagereference pr= new Pagereference('/'+id);
        
        return pr;
    }


    public PageReference editAccount() {
      String id=PageUtils.get('oid');
        Pagereference pr= new Pagereference('/'+id+'/e');
        
        return pr;
    }


   public ApexPages.StandardSetController Con{
        get {
            if(con== null) {
                con= new ApexPages.StandardSetController(Database.getQueryLocator([select id,name,AccountNumber from Account]));
            }
            con.setPageSize(5);
            return con;
        }
        set;
    }
     
    public List<Account> getOpportunities() {
         return (List<Account>) con.getRecords();
    }
     
     /*** Pagination control***/
     
     // indicates whether there are more records after the current page set.
    public Boolean hasNext {
        get {
            return con.getHasNext();
        }
        set;
    }
  
    // indicates whether there are more records before the current page set.
    public Boolean hasPrevious {
        get {
            return con.getHasPrevious();
        }
        set;
    }
  
    // returns the page number of the current page set
    public Integer pageNumber {
        get {
            return con.getPageNumber();
        }
        set;
    }
  
    // returns the first page of records
    public void first() {
        con.first();
    }
  
    // returns the last page of records
    public void last() {
        con.last();
    }
  
    // returns the previous page of records
    public void previous() {
        con.previous();
    }
  
    // returns the next page of records
    public void next() {
        con.next();
    }
  
    // returns the PageReference of the original page, if known, or the home page.
    public void cancel() {
        con.cancel();
    }
     

}